package com.example.backend_zaq.controller;

import com.example.backend_zaq.entity.Author;
import com.example.backend_zaq.repository.AuthorRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@RequestMapping("/author")
public class AuthorController {
    @Autowired
    private AuthorRepository authorRepository;

    @GetMapping("/findAll")
    public List<Author> findAll(){
        return authorRepository.findAll();
    }
}
